package com.bookcloud.java21.chapter3.循环结构_for循环foreach35;

/** 3.5循环结构 — for循环for each */
public class Lesson35 {
  public static void main(String[] args) {
    // 定义一个数组
    int[] scores = {90, 80, 70, 60, 50};
    // 传统的for循环
    for (int i = 0; i < scores.length; i++) {
      System.out.println(scores[i]);
    }
    System.out.println("======================");
    // 遍历数组
    for (var score : scores) {
      System.out.println(score);
    }
  }
}
